
import Parent from "./parent";
import { useChangeName, useTestAge, useTestName, useInitTest } from 'state'
import { useEffect } from "react";
const Test = () => {
    const name = useTestName();
    console.log("name:", name)
    const age = useTestAge();
    console.log("age", age)
    const setName = useChangeName()
    const init = useInitTest()
    const handleClick = () => {
        setName("张三李四")
    }
    useEffect(() => {
        debugger
       // init({ name: 'init', age: 10 })
    }, [])
    return (
        <Parent>
            <button onClick={handleClick}>
                更新name
            </button>
        </Parent>
    )
}
export default Test